#ifndef __DLLIST_H__
#define __DLLIST_H__

struct _DLLElem
{
  void *pvData;
  struct _DLLElem *pPrevDLLElem;
  struct _DLLElem *pNextDLLElem;
};

typedef struct _DLLElem DLLELEM, *PDLLELEM;

struct _DLList
{
  PDLLELEM pHeadDLLElem;
  PDLLELEM pTailDLLElem;
};

typedef struct _DLList DLLIST, *PDLLIST;

void DLL_Init(PDLLIST pdll);
void DLL_Kill(PDLLIST pdll);
PDLLELEM DLL_InsertHead(PDLLIST pdll, void *pvData);
PDLLELEM DLL_InsertAfter(PDLLIST pdll, PDLLELEM pdllElem, void *pvData);
PDLLELEM DLL_InsertBefore(PDLLIST pdll, PDLLELEM pdllElem, void *pvData);
PDLLELEM DLL_InsertTail(PDLLIST pdll, void *pvData);
PDLLELEM DLL_GetHeadElem(PDLLIST pdll);
PDLLELEM DLL_GetTailElem(PDLLIST pdll);
void* DLL_GetNextElem(PDLLELEM *ppElem);
void* DLL_GetPrevElem(PDLLELEM *ppElem);
void* DLL_RemoveHead(PDLLIST pdll);
int DLL_IsEmpty(PDLLIST pdll);

#endif /* __DLLIST_H__ */

